package com.yanchangapp.base;


import com.yanchangapp.BuildConfig;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;

public class NoHeadClient {
    private final OkHttpClient mClient;

    public OkHttpClient getClient() {
        return mClient;
    }

    public NoHeadClient(){
        //OkHttpClient
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        // -------- 在这里获得 token,通过数据库缓存 ********-----------
        if (BuildConfig.DEBUG) {
            // Log信息拦截器
            HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
            loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            //设置 Debug Log 模式
            builder.addInterceptor(loggingInterceptor);
        }
        mClient = builder.build();
    }
}
